package com.controller;

import com.dto.JsonResult;
import com.entity.Role;
import com.service.MenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Yadasu
 * @date 2020/12/22 9:22
 */
@RestController
public class MenusController {


    @Autowired
    private MenusService menusService;

    @GetMapping("/api/admin/role/menu")
    public JsonResult checkMens(){
        return JsonResult.buildSuccess(200,menusService.findMenuTop());
    }

    @PostMapping("/api/admin/role/rid")
    public JsonResult designatedRole(@RequestBody Role role){
        return JsonResult.buildSuccess(200,menusService.findMenuByUid(role));
    }

}
